import scrapy
from scrapy_education.items import ScrapyEducationItem

class EducationSpider(scrapy.Spider):
    name = "education"
    allowed_domains = ["www.jyb.cn"]
    start_urls = ["http://www.jyb.cn/rmtlistgdjy/index_5.html"]

    def parse(self, response):
        ullist=response.xpath("//ul[@class='yxj_list']/li")
        for i in ullist:
            title=i.xpath("./a/@title").extract_first()
            author=i.xpath(".//span[@class='js_author']/text()").extract_first()
            content=i.xpath(".//p[@class='abs']/text()").extract_first()
            news=ScrapyEducationItem(title=title,author=author[10:],content=content[10:])
            # print(title,author)
            yield news
        pass
